package com.lyf.design.learn.designmodel.singleton;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/1
 * @VERSION 1.0
 * @DESC
 * 1.饿汉式
 * JVM 保证线程安全-推荐使用
 * 缺点：不用也会加载，浪费内存资源
 */
public class Main1 {
    private static final Main1 INSTANCE = new Main1();
    private Main1(){}
    static Main1 getInstance(){return INSTANCE;}
    void method(){}
}
